home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Discover France
/
Discover France.iso
/
setup.mst
< prev
next >
Wrap
Text File
|
1995-09-26
|
12KB
|
435 lines
'**************************************************************************
'* MSSetup Telemedia
'**************************************************************************
'$DEFINE DEBUG ''Define for script development/debugging
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'$INCLUDE 'setst.inc'
''Dialog ID's
CONST ASKQUIT = 200
CONST DESTPATH = 300
CONST EXITFAILURE = 400
CONST EXITQUIT = 600
CONST EXITSUCCESS = 700
CONST OPTIONS = 800
CONST APPHELP = 900
CONST RESTART = 2600
CONST RESTARTII = 2700
CONST CUSTINST = 6200
CONST TELEINST = 6250
CONST TOOBIG = 6300
CONST BADPATH = 6400
''Bitmap ID
CONST LOGO = 1
''File Types
CONST APPFILES = 1
CONST OPTFILES1 = 2
CONST OPTFILES2 = 3
GLOBAL SRCDIR$
GLOBAL DEST$ ''Default destination directory.
GLOBAL WINDRIVE$ ''Windows drive letter.
GLOBAL WINDIR$
GLOBAL WINSYSDIR$
GLOBAL TBKDIR$
GLOBAL SndDIR$
GLOBAL SndZiel$
GLOBAL TBKDEST$
GLOBAL NEEDET&
GLOBAL DRVSPACE&
GLOBAL tb15Path$
'' Driver
CONST ADDVFW = 1
GLOBAL VFWPATH$
''CustInst list symbol names
''Dialog list symbol names
GLOBAL STATUSTEXT$
GLOBAL DRIVETEXT$
DECLARE SUB BuildCopyList
DECLARE SUB CalculateCopyList
DECLARE SUB SetDriveStatus
DECLARE SUB RegisterEntries
DECLARE SUB CreateIniEntries
DECLARE SUB SetupProgman
DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
DECLARE FUNCTION OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
DECLARE FUNCTION VflatdPresent LIB "iniupd.DLL" AS INTEGER
DECLARE SUB Reboot LIB "iniupd.dll"
DECLARE fUNCTION ExitWindowsExec LIB "User" (Exec$, Param$) AS INTEGER
TRAP CleanupTrap From "MSSHLSTF.DLL"
End Trap
Inst% = HinstFrame()
ii% = CreateCover(0, 0, 0, 0, 0)
ret% = Ctl3dRegister(Inst%)
ret% = Ctl3dAutoSubClass(Inst%)
hSetup = InitSetup(COMMAND$)
hWnd% = HwndFrame()
ret% = SubSetMainWin(hWnd%)
ii% = CloseCover()
WIN32ENABLED% = 0
MajorVer% = GetWindowsMajorVersion()
MinorVer% = GetWindowsMinorVersion()
IF MajorVer% < 3 OR (MajorVer% = 3 AND MinorVer% < 10) THEN
i% = DoMsgBox("Microsoft Windows version 3.10 is required to run this program.", "Installation Problem", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
END IF
IF DeviceColor() <= 256 THEN
ii% = DoMsgBox("Please, Set Your video number of colors at least 32,000", "Hardware", MB_OK)
GOTO QUIT
END IF
ON ERROR GOTO QUIT
INIT:
CUIDLL$ = "mscuistf.dll" ''custom user interface dll
HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
SetTitle "Voyage in France"
VFWPATH$ = "VFW\"
szInf$ = GetSymbolValue("STF_SRCINFPATH")
IF szInf$ = "" THEN
szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
END IF
ReadInfFile szInf$
WINDRIVE$ = UCASE$(MID$(GetWindowsDir, 1, 1))
DEST$ = WINDRIVE$ + ":\France"
WINDIR$ = GetWindowsDir()
WINSYSDIR$ = GetWindowsSysDir()
''CustInst list symbols
STATUSTEXT$ = "StatusItemsText"
DRIVETEXT$ = "DriveStatusText"
FOR i% = 1 TO 3 STEP 1
AddListItem STATUSTEXT$, ""
NEXT i%
FOR i% = 1 TO 2 STEP 1
AddListItem DRIVETEXT$, ""
NEXT i%
ReplaceListItem DRIVETEXT$, 2, DEST$
SetDriveStatus
CUSTINST:
sz$ = UIStartDlg(CUIDLL$, TELEINST, "FTeleInstDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
''Install only if it will fit.
BuildCopyList
CalculateCopyList
IF NEEDET& <> 0 THEN
GOSUB TOOBIG
GOTO CUSTINST
END IF
UIPop 1
GOTO INSTALL
ELSEIF sz$ = "PATH" THEN
GOTO GETPATH
ELSEIF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO CUSTINST
ELSE
GOSUB ASKQUIT
GOTO CUSTINST
END IF
INSTALL:
CreateDir DEST$, cmoNone
BuildCopyList
CopyFilesInCopyList
CreateIniEntries
RegisterEntries
SetupProgman
RESTRT% = RestartListEmpty ()
Exe$ = DEST$ + "\_msrstrt.exe"
Batch$ = DEST$ + "\_mssetup.bat"
empty$ = ""
RESTART:
IF RESTRT% = 0 THEN
sz$ = UIStartDlg(cuidll$, RESTART, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
GOTO RESTART
ENDIF
I% = ExitExecRestart ()
RemoveFile Exe$, cmoForce
RemoveFile Batch$, cmoForce
END
ELSE
sz$ = UIStartDlg(CUIDLL$, RESTARTII, "FQuitDlgProc", 0, "")
IF sz$ = "CONTINUE" THEN
I% = ExitWindowsExec (Exe$, empty$)
IF I% = 0 THEN
GOTO RESTART
ELSE
END
ENDIF
ELSEIF sz$ = "EXIT" THEN
UIPopAll
END
ELSEIF sz$ = "REACTIVATE" THEN
GOTO RESTART
ELSE
UIPop 1
END IF
END IF
QUIT:
''ON ERROR GOTO ERRQUIT
IF ERR = 0 THEN
dlg% = EXITSUCCESS
ELSEIF ERR = STFQUIT THEN
dlg% = EXITQUIT
ELSE
dlg% = EXITQUIT ''EXITFAILURE
END IF
ERRQUIT:
i% = DoMsgBox("VOYAGE IN FRANCE is not installed properly!", "Setup Error", MB_OK+MB_TASKMODAL+MB_ICONHAND)
END
GETPATH:
SetSymbolValue "EditTextIn", DEST$
SetSymbolValue "EditFocus", "END"
GETPATHL1:
sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
IF sz$ = "CONTINUE" THEN
olddest$ = DEST$
DEST$ = GetSymbolValue("EditTextOut")
''Validate new path.
IF IsDirWritable(DEST$) = 0 THEN
GOSUB BADPATH
GOTO GETPATHL1
END IF
UIPop 1
''Truncate display if too long.
IF LEN(DEST$) > 23 THEN
ReplaceListItem DRIVETEXT$, 2, MID$(DEST$, 1, 23)+"..."
ELSE
ReplaceListItem DRIVETEXT$, 2, DEST$
END IF
''Recalc if path changed.
IF (olddest$ <> DEST$) AND (olddest$ <> DEST$+"\") AND (olddest$+"\" <> DEST$) THEN
SetDriveStatus
END IF
olddest$ = ""
GOTO CUSTINST
ELSEIF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO GETPATHL1
ELSEIF sz$ = "EXIT" THEN
GOSUB ASKQUIT
GOTO GETPATHL1
ELSE
UIPop 1
GOTO CUSTINST
END IF
TOOBIG:
sz$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO TOOBIG
END IF
UIPop 1
RETURN
BADPATH:
sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
IF sz$ = "REACTIVATE" THEN
SetDriveStatus
GOTO BADPATH
END IF
UIPop 1
RETURN
ASKQUIT:
sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
IF sz$ = "EXIT" THEN
UIPopAll
ERROR STFQUIT
ELSEIF sz$ = "REACTIVATE" THEN
GOTO ASKQUIT
ELSE
UIPop 1
END IF
RETURN
SUB CalculateCopyList STATIC
NEEDET& = GetCopyListCost("", "", "")
END SUB
SUB SetupProgman STATIC
'' Todo Add Progman Commands
CreateProgmanGroup "MULTIMEDIA from E.M.M.E.", "", cmoOverwrite
ShowProgmanGroup "MULTIMEDIA from E.M.M.E.", 1, cmoNone
CreateProgmanItem "MULTIMEDIA from E.M.M.E.", "Voyage in France", MakePath(dest$,"france.exe"),MakePath(DEST$,"france.exe"), cmoOverwrite
END SUB
SUB BuildCopyList STATIC
SRCDIR$ = GetSymbolValue("STF_SRCDIR")
TBSRC$ = MakePath(SRCDIR$, TBKDIR$)
sndSRC$ = MakePath(SRCDIR$, sndDIR$)
snddest$ = MakePath(Dest$, SndZiel$)
TBKDEST$ = MakePath(WINDIR$, "asym\runtime\")
source$ = MakePath(srcdir$, "setup\")
ClearCopyList
adds